package exception;

/**
 * @author: Atosw
 * @date: 2024/11/10
 * @version: 1.0
 * @description:
 */
public class ServiceException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer errorCode;

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public ServiceException() {
    }

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(Integer errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public ServiceException(ErrorEnum error) {
        super(error.getMessage());
        this.errorCode = error.getErrorCode();
    }
}
